package org.apache.commons.pool2.impl;

import org.apache.commons.pool2.PooledObject;

/**
 * 类的描述
 *
 * @author ztkool
 * @version v
 */
public class DefaultEvictionPolicy<T> implements EvictionPolicy<T> {
    public DefaultEvictionPolicy() {
    }

    @Override
    public boolean evict(EvictionConfig config, PooledObject<T> underTest, int idleCount) {
        return config.getIdleSoftEvictTime() < underTest.getIdleTimeMillis() && config.getMinIdle() < idleCount || config.getIdleEvictTime() < underTest.getIdleTimeMillis();
    }
}
